<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateYsSchedulesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('schedules', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('scheduleable_id')->unsigned()->comment('定时类型的id');
			$table->string('scheduleable_type')->comment('定时类型的模型');
			$table->string('type')->comment('定时的类型');
			$table->timestamp('schedule_at')->nullable()->comment('触发时间');
			$table->timestamp('run_at')->nullable()->comment('执行时间');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('schedules');
	}

}
